'
' DotNetNuke Ita - http://dotnetnukeita.blogspot.com
' Daniele Lembo
'


Imports System
Imports DotNetNuke

Namespace DotNetNukeIta.Modules.RSSNuke.Database

    ''' -----------------------------------------------------------------------------
    ''' <summary>
    ''' An abstract class for the data access layer
    ''' </summary>
    ''' <remarks>
    ''' </remarks>
    ''' <history>
    ''' </history>
    ''' -----------------------------------------------------------------------------
    Public MustInherit Class DataProvider

#Region "Shared/Static Methods"

        ' singleton reference to the instantiated object 
        Private Shared objProvider As DataProvider = Nothing

        ' constructor
        Shared Sub New()
            CreateProvider()
        End Sub

        ' dynamically create provider
        Private Shared Sub CreateProvider()
            objProvider = CType(Framework.Reflection.CreateObject("data", "DotNetNukeIta.Modules.RSSNuke", ""), DataProvider)
        End Sub

        ' return the provider
        Public Shared Shadows Function Instance() As DataProvider
            Return objProvider
        End Function

#End Region

#Region "Abstract methods"

        Public MustOverride Function GetRSSFeeds(ByVal ModuleId As Integer) As IDataReader
        Public MustOverride Function GetRSSFeed(ByVal ModuleId As Integer, ByVal ItemId As Integer) As IDataReader
        Public MustOverride Sub AddRSSFeed(ByVal ModuleId As Integer, ByVal Content As String, ByVal UserId As Integer)
        Public MustOverride Sub UpdateRSSFeed(ByVal ModuleId As Integer, ByVal ItemId As Integer, ByVal Content As String, ByVal UserId As Integer)
        Public MustOverride Sub DeleteRSSFeed(ByVal ModuleId As Integer, ByVal ItemId As Integer)

#End Region

    End Class

End Namespace